package com.mxl.dao.cashorder.impl;

import java.util.List;

import org.hibernate.criterion.Restrictions;

import com.mxl.dao.cashorder.CustomMerchantDao;
import com.mxl.dao.cashorder.model.CustomMerchant;
import com.mxl.datebase.orm.hibernate.BaseDaoSupport;

public class CustomMerchantDaoImpl extends BaseDaoSupport<CustomMerchant, Long>
		implements CustomMerchantDao {

	public List<CustomMerchant> findByMembercode(String membercode) {
		return this.find(Restrictions.eq("memberCode", membercode));
	}

	public CustomMerchant findByMembercodeAndBosstype(String membercode,
			int bossType) {
		List<CustomMerchant> clist = this.find(
				Restrictions.eq("memberCode", membercode),
				Restrictions.eq("bossType", bossType));
		return clist != null && !clist.isEmpty() ? clist.get(0) : null;
	}

}
